package com.fengcheng.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fengcheng.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Insert("insert into users (name, password) values (#{name},#{password}) ")
    void InsertUser(@Param("name") String name, @Param("password") String password);

    @Select("select id, name, password from users where name = #{name};")
    User queryByName(@Param("name") String name);

    @Delete("delete from users where name = #{name}")
    void DeleteUser(@Param("name") String name);

}
